﻿using Blog.Application.Contract.Blogs;
using Blog.Application.Contract.Blogs.Dto;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Pomelo.EntityFrameworkCore.MySql.Query.Internal;

namespace Blog.HttpApi.Host.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class BlogTypeController : ControllerBase
    {
        private readonly IBlogTypeService _blogTypeService;

        public BlogTypeController(IBlogTypeService blogTypeService)
        {
            _blogTypeService = blogTypeService;
        }

        /// <summary>
        /// 创建博客类型
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task CreateAsync(CreateBlogTypeDto input)
        {
            await _blogTypeService.CreateAsync(input);
        }

        /// <summary>
        /// 删除博客类型
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        [HttpDelete("{id}")]
        public async Task DeleteAsync(Guid id)
        {
            await _blogTypeService.DeleteAsync(id);
        }
    }
}
